using System.Collections.Generic;

namespace SoNerdy.Player.Models {    
    public class PlayerMediaViewModel {
        public string MediaJSON { get; set; }
    }
    
    public class MediaType {
        public static string Audio { get { return "Audio"; } }
        public static string Video { get { return "Video"; } }        
    }
    
    public class PlayerMedia {
        public PlayerMedia() {
            Initialize();
        }

        public PlayerMedia(string title, string mediaType) {
            Title = title;
            MediaType = mediaType;
            Initialize();
        }
        
        private void Initialize() {
            Files = new List<PlayerMediaFile>();
            Height = 480;
            Width = 640;
        }

        public string Title { get; set; }
        public string MediaType { get; set; }
        public int Width { get; set; }
        public int Height { get; set; }

        public IList<PlayerMediaFile> Files { get; set; }
        public void Add(string url, string contentType) {
            var file = new PlayerMediaFile() {Url = url, ContentType = contentType};
            Files.Add(file);
        }
    }

    public class PlayerMediaFile {        
        public string Url { get; set; }
        public string ContentType { get; set; }
    }
}